package com.thymeleaf.demo.controller;


import com.thymeleaf.demo.model.MallAdmin;
import com.thymeleaf.demo.service.impl.MallAdminServiceImpl;
import com.thymeleaf.demo.util.result.BaseResult;
import com.thymeleaf.demo.util.result.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sunny
 * @since 2020-12-23
 */
@Controller
@RequestMapping("/mall/admin/mallAdmin")
public class MallAdminController {
    @Autowired
    MallAdminServiceImpl adminService;
    @Autowired
    ResultUtil resultUtil;

    @PostMapping("save")
    @ResponseBody
    public BaseResult<Boolean> save(@RequestBody MallAdmin admin) throws Exception {
        return resultUtil.success(adminService.insertAdmin(admin));
    }
}
